package cn.imvc.app.models;

import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.web.util.matcher.RequestMatcher;

import cn.imvc.app.entities.GoodsOrder;
import cn.imvc.app.entities.Orders;
import cn.imvc.app.entities.StorageOrder;
import cn.imvc.data.domain.ViewRequest;

public interface GoodsOrderModel {
	LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> getRequestMap();
	
	Page<GoodsOrder> find(ViewRequest viewRequest);
	
	GoodsOrder get(int id);

	GoodsOrder save(GoodsOrder goodsOrder);
	
	GoodsOrder update(GoodsOrder goodsOrder);

	void delete(int id);

	void deleteBatch(int[] ids);
	
	List<GoodsOrder> findAll();
	
	boolean updateSyncState(StorageOrder storageOrder);
	
	boolean updateSyncStateByPreState(StorageOrder storageOrder,Byte state);
	
	boolean updateDeliveryFailed(int id);

	List<GoodsOrder> findByState(Byte value);

	List<GoodsOrder> findByOrder(Orders order);

	List<GoodsOrder> findByStateAndCreatedAtLessThan(Byte value, Date time);
}
